<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::group('', function () {
    Route::any('index/index', 'admin/Index/index');//首页
    Route::any('index/initMemu', 'admin/Index/initMemu');//左侧菜单
    Route::any('home/index', 'admin/Home/index');//欢迎页
    Route::rule('login/logout', 'admin/Login/logout');
    Route::any('adminuser/userpassword', 'admin/AdminUser/userpassword');//修改密码
    Route::any('adminuser/updatePassword', 'admin/AdminUser/updatePassword')->append(['explain' => "修改密码"])
        ->middleware(\app\admin\middleware\SystemLogBase::class);//保存修改密码
    Route::group('', function () {
        Route::any('home/clearcache', 'admin/Home/clearcache') ->middleware(\app\admin\middleware\SystemLogBase::class);//清除缓存
        Route::group('', function () {
            Route::resource('AdminUser', 'AdminUser');  //管理员管理
            Route::get('AuthGroup/auth', 'AuthGroup/auth');  //授权
            Route::post('AuthGroup/updateAuthGroupRule', 'AuthGroup/updateAuthGroupRule');  //保存授权
            Route::resource('AuthGroup', 'AuthGroup');  //权限组
            Route::resource('Menu', 'Menu');  //菜单管理

        })   ->middleware(\app\admin\middleware\SystemLogBase::class);

    })->middleware(\app\admin\middleware\Auth::class);
});

